<?php

namespace App\Jobs;

use App\Handlers\EfutureHandle;
use App\Models\WxuserMcard;
use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class PushCardMessage implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public $tries = 5;

    public $wxuser_mcard;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(WxuserMcard $wxuserMcard)
    {
        $this->wxuser_mcard = $wxuserMcard;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $res = app(EfutureHandle::class)->addNewMcard($this->wxuser_mcard);
    }

    /**
     * The job failed to process.
     *
     * @param  Exception  $exception
     * @return void
     */
    public function failed(Exception $exception)
    {

    }
}
